# P116-119
#用in来检查成员关系
fruits ={}
fruits['apple']=10
if 'apple'in fruits:
    print('True')
else:
    print('False')

if 'bananas'in fruits:
    print('True')
else:
    print('False')
#%%
#用"not in"替换‘in’
fruits ={}
fruits['apple']=10
if 'pears' not in fruits:
    fruits['pears'] =0   #初始化
fruits['pears'] +=1      #增加一次
print(fruits)